var port=document.getElementById("port");
var ps=document.getElementById("ps");
var yz=document.getElementById("yz");
document.body.onkeydown=function(e){
							if(!e)e=event;
							if(e.keyCode==13 && ps.value && port.value)
								Log();
						}
port.onkeydown=function(e){
					if(!e)e=event;
					if(e.keyCode==13 && this.value)
						ps.focus();
				}
function Log(){
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+7);
	document.cookie="passport="+document.getElementById("port").value+";expires="+exdate.toGMTString()+";";
	var ps=document.getElementById("ps").value;
	var p=document.getElementById("password");
	p.value=hex_md5(ps);
	document.forms[0].submit();
	// var exdate=new Date()
	// exdate.setDate(exdate.getDate()+7);
	// document.cookie="passport="+document.getElementById("port").value+";expires="+exdate.toGMTString()+";";
	// var ps=document.getElementById("ps").value;
	// var passport = document.getElementById("port");
	// var pass = hex_md5(ps);
	// $("#xubox_layer1").show();
	// $("#xubox_shade1").show();
	// $.post('dlogin.php',{passport:passport.value,password:pass},function(res){
		// res = JSON.parse(res);
		// if(res.reqState=='fail'){
			// alert(res.msg);
			// $("#xubox_layer1").hide();
			// $("#xubox_shade1").hide();
		// }else{
			// window.parent.location.href="home.html";
		// }
	// });
};
function inputTxt(t,p){
	if(p){
		if(t.value==""){
			t.value='';
		}
		t.style.color='#333';
	}
	else{
		if(t.value==""){
			t.value='';
		}
		t.style.color='#C9C9C9';
	}
}
function cl(c){
	if(c.value=="商户ID或手机号码"){
		c.value="";
		c.style.color="#000";
		return;
	}
	if(c.value==""){
		c.value="商户ID或手机号码";
		c.style.color="#C9C9C9";
		return;
	}
}
/*if(!Cookie.getCookie("ip_province")){
	$.ajax({
		"url":"ajaxCall/ip_city.php",
		"async":true,
		"dataType":"json",
		"success":function(data){
			Cookie.setCookie("ip_province",data['province'].substr(0,2),365);
			Cookie.setCookie("ip_city",data['city'],365);
		}
	})
};*/